#ifndef wm_frame_h
#define wm_frame_h
/*
 * Sylvain BERTRAND <digital.ragnarok@gmail.com>
 * code protected by GNU GPL v3
 */
enum wm_frame_context {
	WM_FRAME_CONTEXT_NONE,
	WM_FRAME_CONTEXT_DESKTOP,
	WM_FRAME_CONTEXT_ROOT,
	WM_FRAME_CONTEXT_CLIENT,
	WM_FRAME_CONTEXT_FRAME,
	WM_FRAME_CONTEXT_MOVE_RESIZE,
	WM_FRAME_NUM_CONTEXTS
};
#define FRAME_CONTEXT(co, cl) ((cl && cl->type != WM_CLIENT_TYPE_DESKTOP) ? co == WM_FRAME_CONTEXT_FRAME : FALSE)
#define CLIENT_CONTEXT(co, cl) ((cl && cl->type == WM_CLIENT_TYPE_DESKTOP) ? co == WM_FRAME_CONTEXT_DESKTOP \
	: co == WM_FRAME_CONTEXT_CLIENT)
struct wm_frame {
	struct wm_client *client;
	Window window;
	struct strut size;
	struct strut oldsize;
	struct wm_rect area;
	gboolean visible;
	Colormap colormap;
	gint width;
	gboolean max_horz;
	gboolean max_vert;
	gboolean focused;
};
struct wm_frame *frame_new(struct wm_client *c);
void frame_free(struct wm_frame *self);
void frame_show(struct wm_frame *self);
void frame_hide(struct wm_frame *self);
void frame_adjust_shape_kind(struct wm_frame *self, int kind);
void frame_adjust_shape(struct wm_frame *self);
void frame_adjust_area(struct wm_frame *self, gboolean moved, gboolean resized, gboolean fake);
void frame_adjust_focus(struct wm_frame *self, gboolean hilite);
void frame_grab_client(struct wm_frame *self);
void frame_release_client(struct wm_frame *self);
enum wm_frame_context frame_context_from_string(const gchar *name);
gboolean frame_next_context_from_string(gchar *names, enum wm_frame_context *cx);
enum wm_frame_context frame_context(struct wm_client *self, Window win, gint x, gint y);
void frame_rect_to_frame(struct wm_frame *self, struct wm_rect *r);
#endif
